<script setup>
const emit = defineEmits(['addAnnotation']); // 使用数组语法来声明事件

const addAnnotation = () => {
  console.log('addAnnotation is called');
  emit('addAnnotation');
}
</script>

<template>
  <div class="annotation">
    <i class="iconfont icon-pizhu" @click="addAnnotation"></i>
    <p class="word" @click="addAnnotation">批注</p>
  </div>
</template>

<style scoped>
.iconfont {
  font-family: "iconfont" !important;
  font-size: 30px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.iconfont:hover {
  color: red;
}

.annotation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: white;
  width: 60px;
  height: 60px;
  border-radius: 10px;
}

.word {
  font-size: 13px;
  margin: 0 5px 5px 5px;
}

.word:hover {
  color: red;
}
</style>